﻿using Microsoft.EntityFrameworkCore;
using Abp.Zero.EntityFrameworkCore;
using ABPMPATest.Authorization.Roles;
using ABPMPATest.Authorization.Users;
using ABPMPATest.MultiTenancy;
using ABPMPATest.PhoneBooks.Persons;
using ABPMPATest.PhoneBooks.PhoneNumbers;

namespace ABPMPATest.EntityFrameworkCore
{
    public class ABPMPATestDbContext : AbpZeroDbContext<Tenant, Role, User, ABPMPATestDbContext>
    {
        /* Define a DbSet for each entity of the application */
        
        public ABPMPATestDbContext(DbContextOptions<ABPMPATestDbContext> options)
            : base(options)
        {
        }
        
        public  DbSet<Person> Person { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Person>().ToTable("Person", "PB");
            modelBuilder.Entity<PhoneNumber>().ToTable("PhoneNumber", "PB");

            base.OnModelCreating(modelBuilder);
        }
    }
}
